<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/jquery-1.11.0.js"></script>
		<style type="text/css">
			td{
				text-align: center;
			}
		</style>
	</head>
	<body>
		<div id="dj">
			<table border="" cellspacing="0" cellpadding="5">
				
			</table>
		</div>
	</body>
	<!--<script type="text/javascript">
		var htmltxt = '';
		var a = [
			{id:'name1',name:'第1列'},
			{id:'name2',name:'第2列'},
			{id:'name3',name:'第3列'},
			{id:'name4',name:'第4列'},
			{id:'name5',name:'第5列'}
		]
		var b = [
			{name1:'hfjudsf',name2:'fsdegf',name3:'zsdfg',name4:'agf',name5:'agrs'},
			{name1:'fsdfs',name2:'aSgd',name3:'zasdfg',name4:'zdfg',name5:'ag'},
			{name1:'asfd',name2:'agsd',name3:'zasfgd',name4:'zsfga',name5:'agf'},
			{name1:'gsdag',name2:'dgfg',name3:'dgf',name4:'ag',name5:'a该方法'}
		]
		$(function(){
			htmltxt += '<tr><th>序号</th>';
			a.map(function(ele){
				htmltxt += '<th>' + ele.name + '</th>';
			})
			htmltxt += '</tr>';
			$('#dj table').html(htmltxt);
			
			for (var i = 0,lena = b.length; i < lena; i++) {
				htmltxt += '<tr><td>' + (i + 1) + '</td>';
				for (var j = 0,lenb = a.length; j < lenb; j++) {
					var id = a[j].id;
					htmltxt += '<td>' + b[i][id] + '</td>';
				}
				htmltxt += '</tr>';
			}
			$('#dj table').html(htmltxt);
			
			// 测试用查看var与let的不同
			var v = [1,2,3,4,5,6,7,8,9,10];
			for (var s = 0; s < v.length; s++) {
				v[s] = function(){
					console.log(s);
				}
			}
			v[5]();
		})
		
		var arr = [{"3name": 1}, {"1name": 2}, {"2name": 3}]
		function dj(a, b) {
			var key1 = parseInt(Object.keys(a)[0]);
			console.log(a);
			console.log(Object.keys(a));
			console.log(Object.keys(a)[0]);
			console.log(parseInt(Object.keys(a)[0]));
            var key2 = parseInt(Object.keys(b)[0]);
            console.log(b);
            console.log(Object.keys(b));
            console.log(Object.keys(b)[0]);
            console.log(parseInt(Object.keys(b)[0]));
            return key1 - key2;
		}
		arr.sort(dj);
		console.log(arr);
	</script>-->
	
	<script type="text/javascript">
		var data = '{"id": "160","gmtCreate": 1516260683000,"gmtModified": 1516260683000}'
//		console.log(JSON.parse(data)["gmtCreate"]);
		var a = "基本常识v的是v是的v萨达2"
		console.log(a.slice(0, -1));
//		console.log(typeof(a.slice(-1)));
	</script>
</html>
